
#include "tls.h"

#include <stdio.h>
#include <vector>

int main ( int argc, char* argv[] )
{
	tls < int > foo ;
	tls < int > var = foo ;
	int tmp = *foo + 111 ;

	*foo = 1000 ;
	*var = tmp ;

	printf ( "foo: %d\n", *foo ) ;
	printf ( "var: %d\n", *var ) ;

	//-----------------------------------------------------

	tls < std::vector<int> > vec ;
	tls < std::vector<int> > * ptr = &vec ;

	vec->push_back ( 100 ) ;
	(*vec).push_back ( 101 ) ;
	(*ptr)->push_back ( 102 ) ;

	printf ( "size: %d\n", vec->size() ) ;
	printf ( " [0]: %d\n", (*vec)[0] ) ;
	printf ( " [1]: %d\n", (*vec)[1] ) ;
	printf ( " [2]: %d\n", (*vec)[2] ) ;

	return 0 ;
}